/*
 * @Description: 用户与权限页面
 * @Author: Rfan
 * @Date: 2022-04-11 13:38:38
 * @LastEditTime: 2022-04-20 18:09:44
 */

import { lazy } from 'react';
import Layout from '@/layout';
import lazyLoad from '@/routes/components/lazyLoad';

// 组织与用户
export const UserRightOrgAndUser = lazy(
  () => import(/* webpackChunkName: "UserRight" */ '@/view/userRight/OrgAndUser/OrgAndUserMain')
);

// 角色管理
export const UserRightRole = lazy(
  () => import(/* webpackChunkName: "UserRight" */ '@/view/userRight/Role/RoleMain')
);

// 档案管理权限规则
export const UserRightManageRule = lazy(
  () => import(/* webpackChunkName: "UserRight" */ '@/view/userRight/ManageRule/ManageRuleMain')
);

// 知悉范围设置
export const UserRightScopeOfKnowledge = lazy(
  () =>
    import(
      /* webpackChunkName: "UserRight" */ '@/view/userRight/ScopeOfKnowledge/ScopeOfKnowledgeMain'
    )
);

// 利用权限
export const UserRightUseRight = lazy(
  () => import(/* webpackChunkName: "UserRight" */ '@/view/userRight/UseRight/UseRightMain')
);

// 利用权限规则
export const UserRightUseRule = lazy(
  () => import(/* webpackChunkName: "UserRight" */ '@/view/userRight/UseRule/UseRuleMain')
);

const UserRightRoutes = [
  {
    path: '/user-right',
    element: <Layout />,
    meta: {
      title: '用户与权限'
    },
    children: [
      {
        path: 'org-and-user',
        element: lazyLoad(UserRightOrgAndUser),
        meta: {
          title: '组织与用户'
        }
      },
      {
        path: 'role',
        element: lazyLoad(UserRightRole),
        meta: {
          title: '角色管理'
        }
      },
      {
        path: 'manage-rule',
        element: lazyLoad(UserRightManageRule),
        meta: {
          title: '档案管理权限规则'
        }
      },
      {
        path: 'scope-of-knowledge',
        element: lazyLoad(UserRightScopeOfKnowledge),
        meta: {
          title: '知悉范围设置'
        }
      },
      {
        path: 'use-right',
        element: lazyLoad(UserRightUseRight),
        meta: {
          title: '利用权限'
        }
      },
      {
        path: 'use-rule',
        element: lazyLoad(UserRightUseRule),
        meta: {
          title: '利用权限规则'
        }
      }
    ]
  }
];

export default UserRightRoutes;
